<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">


<f:loadBundle basename="properties.messages" var="msg" />

<h:head>

	<title>#{msg.inbox}</title>

</h:head>

<ui:composition template="/WEB-INF/template/templateAdmin.xhtml">

	<ui:define name="content">
		<f:view locale="#{language.locale}">
			<h:body>

				<div class="inboxDiv">
					<h2>#{msg.viewMessages}</h2>

					<h:form>
						<h:outputLabel rendered="#{!inboxController.size}" value="Nu sunt mesaje in Inbox"></h:outputLabel>
						<h:dataTable value="#{inboxController.emails}" var="item"
							rendered="#{inboxController.size}"
							styleClass="order-table" headerClass="order-table-header"
							rowClasses="order-table-odd-row,order-table-even-row"
							columnClasses="order-table-column" cellpadding="10em">

							<h:column id="column1" headerClass="leftHead">
								<f:facet name="header">
									<h:outputText value="#{msg.sender}" />
								</f:facet>
								<h:outputText value="#{item.sender}"></h:outputText>
							</h:column>

							<h:column id="column2">
								<f:facet name="header">
									<h:outputText value="#{msg.title}" />
								</f:facet>

								<h:outputText value="#{msg[item.type]}"></h:outputText>
							</h:column>

							<h:column id="column3">
								<f:facet name="header">
									<h:outputText value="#{msg.date}">

									</h:outputText>
								</f:facet>

								<h:outputText type="submit" id="data"
									value="#{item.formattedDate}">

								</h:outputText>


							</h:column>

							<h:column id="column4" headerClass="rightHead">

								<f:facet name="header">
									<h:outputText value="#{msg.action}"></h:outputText>
								</f:facet>

								<h:commandLink value="#{msg.open}"
									action="#{inboxController.verificaID(item.id)}">
									<f:param name="id" value="#{item.id}" />

								</h:commandLink>

							</h:column>



						</h:dataTable>
						
					</h:form>

				</div>

			</h:body>
		</f:view>
	</ui:define>
</ui:composition>

</html>